﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Recursos.View
{
    public partial class PermisosView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack && (Request.Cookies["__LOGINCOOKIE__"] == null || Request.Cookies["__LOGINCOOKIE__"].Value == ""))
            {
                //At this point, we do not know if the session ID that we have is a new
                //session ID or if the session ID was passed by the client. 
                //Update the session ID.

                Session.Abandon();
                Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));

                //To make sure that the client clears the session ID cookie, respond to the client to tell 
                //it that we have responded. To do this, set another cookie.
                //   AddRedirCookie();
                //  Response.Redirect(Request.Path);
                Response.Redirect("~/NoAccess.aspx");
            }
        }
    }
}